#include <iostream>
#include <algorithm>
#include <cstring>
#include <string>
#include <map>
#include <vector>

using namespace std;
using LL = long long;
const int N = 110;

int n;
int g[N][N];

int main(){
    freopen("in.txt", "r", stdin);
    freopen("out.txt", "w", stdout);
    ios::sync_with_stdio(false);
    cin.tie(nullptr);

    cin >> n;
    int x = 1, y = n / 2 + 1;
    for(int i = 1; i <= n * n; i ++){
        g[x][y] = i;
        if(x == 1 && y == n) x ++;
        else if(x == 1 && y != n) x = n, y ++;
        else if(y == n && x != 1) x --, y = 1;
        else if(x != 1 && y != n){
            if(g[x - 1][y + 1]){
                x ++;
            }else{
                x --;
                y ++;
            }
        }
    }

    for(int i = 1; i <= n; i ++){
        for(int j = 1; j <= n; j ++){
            cout << g[i][j] << " ";
        }
        cout << '\n';
    }


    return 0;
}  